From 4eb5827a1f680feb1e92d6bd52ac84c7c4c1d488 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 24 Jun 2011 07:49:50 +0000 Subject: [PATCH] Code style cleanups, use strict comparison with $data['PreviousTarget'] per CR --- includes/specials/SpecialBlock.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 7a1ad26eaf..299d758435 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -554,7 +554,8 @@ class SpecialBlock extends SpecialPage { # Give admins a heads-up before they go and block themselves. Much messier # to do this for IPs, but it's pretty unlikely they'd ever get the 'block' # permission anyway, although the code does allow for it - if( $target === $wgUser->getName() && ( $data['PreviousTarget'] != $data['Target'] || !$data['Confirm'] ) ) + if( $target === $wgUser->getName() && + ( $data['PreviousTarget'] != $data['Target'] || !$data['Confirm'] ) ) { return array( 'ipb-blockingself' ); } @@ -634,7 +635,9 @@ class SpecialBlock extends SpecialPage { $status = $block->insert(); if( !$status ) { # Show form unless the user is already aware of this... - if( ( array_key_exists('PreviousTarget', $data ) && $data['PreviousTarget'] != htmlspecialchars( $block->getTarget() ) ) || !$data['Confirm'] ) { + if( !$data['Confirm'] || ( array_key_exists( 'PreviousTarget', $data ) + && $data['PreviousTarget'] !== htmlspecialchars( $block->getTarget() ) ) ) + { return array( array( 'ipb_already_blocked', $block->getTarget() ) ); # Otherwise, try to update the block... } else { -- 2.20.1